Sample Code - SetLogOnInfo Method

This sample code shows the use of the SetLogOnInfo Method (DatabaseTable Object). Modify the following sample code to fit your needs.

Option Explicit

Dim app1 As CRPEAuto.Application
Dim rpt1 As CRPEAuto.Report

Private Sub Form_Load()
    Set app1 = CreateObject("Crystal.CRPE.Application)
    Set rpt1 = app1.OpenReport("c:\reports\myreport.rpt")
End Sub

Private Sub Command1_Click()
    ' Set log on info for the two tables in the report
    rpt1.Database.Tables(1).SetLogOnInfo "CRSS", _
        "pubs", "user1", "password"
    rpt1.Database.Tables(2).SetLogOnInfo "CRSS", _
        "pubs", "user1", "password"

    ' Preview the report
    rpt1.Preview
End Sub


Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com